﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Autodesk.Revit.UI;
using RevitInteractiveUtility.ExternalEventManager;

namespace SampleAndTest.ExternalEventManager.MultiFromDemo
{
	public partial class MultiForm1 : System.Windows.Forms.Form
	{
		public MultiForm1(ExternalCommandData cmdData)
		{
			this.m_cmdData = cmdData;
			this.InitializeComponent();
			this.InitExternalEventRequest();
		}

		private void InitExternalEventRequest()
		{
			ExternalEventManagerSingleton eventManger = ExternalEventManagerSingleton.GetEventManger(false);
			int iRequestId = 1;
			this.m_RequestA = new MultiFormRequestA(iRequestId);
			eventManger.AppendRequest(this.m_RequestA);
		}

		private void button1_Click(object sender, EventArgs e)
		{
			ExternalEventManagerSingleton.GetEventManger(false).DoRequest(1, this.m_cmdData.Application, this.m_cmdData.Application.ActiveUIDocument.Document);
		}

		private ExternalCommandData m_cmdData;

		private MultiFormRequestA m_RequestA;
	}
}
